\(\int \sec ^4(c+d x) (a+b \tan ^2(c+d x)) \, dx\) [432]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 46 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {a \tan (c+d x)}{d}+\frac {(a+b) \tan ^3(c+d x)}{3 d}+\frac {b \tan ^5(c+d x)}{5 d} \]

[Out]

a*tan(d*x+c)/d+1/3*(a+b)*tan(d*x+c)^3/d+1/5*b*tan(d*x+c)^5/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3756, 380} \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {(a+b) \tan ^3(c+d x)}{3 d}+\frac {a \tan (c+d x)}{d}+\frac {b \tan ^5(c+d x)}{5 d} \]

[In]

Int[Sec[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

(a*Tan[c + d*x])/d + ((a + b)*Tan[c + d*x]^3)/(3*d) + (b*Tan[c + d*x]^5)/(5*d)

Rule 380

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n
)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]

Rule 3756

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (1+x^2\right ) \left (a+b x^2\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (a+(a+b) x^2+b x^4\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {a \tan (c+d x)}{d}+\frac {(a+b) \tan ^3(c+d x)}{3 d}+\frac {b \tan ^5(c+d x)}{5 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.15 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {\tan (c+d x) \left (15 a-2 b-b \sec ^2(c+d x)+3 b \sec ^4(c+d x)+5 a \tan ^2(c+d x)\right )}{15 d} \]

[In]

Integrate[Sec[c + d*x]^4*(a + b*Tan[c + d*x]^2),x]

[Out]

(Tan[c + d*x]*(15*a - 2*b - b*Sec[c + d*x]^2 + 3*b*Sec[c + d*x]^4 + 5*a*Tan[c + d*x]^2))/(15*d)

Maple [A] (verified)

Time = 1.30 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.83

method result size
derivativedivides \(\frac {\frac {b \tan \left (d x +c \right )^{5}}{5}+\frac {\left (a +b \right ) \tan \left (d x +c \right )^{3}}{3}+a \tan \left (d x +c \right )}{d}\) \(38\)
default \(\frac {\frac {b \tan \left (d x +c \right )^{5}}{5}+\frac {\left (a +b \right ) \tan \left (d x +c \right )^{3}}{3}+a \tan \left (d x +c \right )}{d}\) \(38\)
risch \(\frac {4 i \left (15 a \,{\mathrm e}^{6 i \left (d x +c \right )}-15 b \,{\mathrm e}^{6 i \left (d x +c \right )}+35 a \,{\mathrm e}^{4 i \left (d x +c \right )}+5 b \,{\mathrm e}^{4 i \left (d x +c \right )}+25 a \,{\mathrm e}^{2 i \left (d x +c \right )}-5 b \,{\mathrm e}^{2 i \left (d x +c \right )}+5 a -b \right )}{15 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}\) \(99\)

[In]

int(sec(d*x+c)^4*(a+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(1/5*b*tan(d*x+c)^5+1/3*(a+b)*tan(d*x+c)^3+a*tan(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.22 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {{\left (2 \, {\left (5 \, a - b\right )} \cos \left (d x + c\right )^{4} + {\left (5 \, a - b\right )} \cos \left (d x + c\right )^{2} + 3 \, b\right )} \sin \left (d x + c\right )}{15 \, d \cos \left (d x + c\right )^{5}} \]

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/15*(2*(5*a - b)*cos(d*x + c)^4 + (5*a - b)*cos(d*x + c)^2 + 3*b)*sin(d*x + c)/(d*cos(d*x + c)^5)

Sympy [F]

\[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \sec ^{4}{\left (c + d x \right )}\, dx \]

[In]

integrate(sec(d*x+c)**4*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*sec(c + d*x)**4, x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.85 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {3 \, b \tan \left (d x + c\right )^{5} + 5 \, {\left (a + b\right )} \tan \left (d x + c\right )^{3} + 15 \, a \tan \left (d x + c\right )}{15 \, d} \]

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/15*(3*b*tan(d*x + c)^5 + 5*(a + b)*tan(d*x + c)^3 + 15*a*tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.46 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.04 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {3 \, b \tan \left (d x + c\right )^{5} + 5 \, a \tan \left (d x + c\right )^{3} + 5 \, b \tan \left (d x + c\right )^{3} + 15 \, a \tan \left (d x + c\right )}{15 \, d} \]

[In]

integrate(sec(d*x+c)^4*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/15*(3*b*tan(d*x + c)^5 + 5*a*tan(d*x + c)^3 + 5*b*tan(d*x + c)^3 + 15*a*tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 12.01 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.87 \[ \int \sec ^4(c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx=\frac {\frac {b\,{\mathrm {tan}\left (c+d\,x\right )}^5}{5}+\left (\frac {a}{3}+\frac {b}{3}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+a\,\mathrm {tan}\left (c+d\,x\right )}{d} \]

[In]

int((a + b*tan(c + d*x)^2)/cos(c + d*x)^4,x)

[Out]

(tan(c + d*x)^3*(a/3 + b/3) + a*tan(c + d*x) + (b*tan(c + d*x)^5)/5)/d